package net.sxnic.ugr.menu.action;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Delete extends MenuAction {

	private static final long serialVersionUID = -3008240868443537008L;

	private static final Log log = LogFactory.getLog(Delete.class);

	private String id;

	public String execute() throws Exception {
		
		 try {						
			 if ((id == null) || ("".equals(id))) {
					//addActionMessage("请指定要删除条目的ID");
					return INPUT;
				}
				
		        //删除菜单
				menuManager.deleteById(id);

				msg = "deleteSuccess";
				log.debug("delete basecode success. id = " + id);
				
			} catch (Exception e) {
				e.printStackTrace();
			}

		 
		return SUCCESS;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
